🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / model / src / commonMain / kotlin / org / meshtastic / core / model / geofence / GeofenceRadiusPresets.kt
Displaying Raw • Download
core/model/src/commonMain/kotlin/org/meshtastic/core/model/geofence/GeofenceRadiusPresets.kt bd2863243bab6eb213401d949839a2bc74dde7e2 (bd286324) Text, 1.87 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.model.geofence
Tff7b72import T7ee787org.meshtastic.proto.Config.DisplayConfig.DisplayUnits
Tff7b72import T7ee787kotlin.math.abs
T8b949e/**
* Radius presets for the waypoint editor. The wire value is ALWAYS metres; the UI renders each value locale-aware via
* `DistanceExtensions`. `0` means "Off" (no circle). Imperial values are chosen to render as clean feet/mile figures.
* Do NOT copy Apple's imperial-only table — the selector list is locale-driven by [forUnits].
*/
Tf0883e@SuppressTb4b4b4(Ta5d6ff"Ta5d6ffMagicNumberTa5d6ff"Tb4b4b4)
Tff7b72object T56d364GeofenceRadiusPresets Tb4b4b4{
T8b949e/** Off, 100 m, 250 m, 500 m, 1 km, 2 km, 5 km. */
Tff7b72val Te6edf3METRIC_METERSTb4b4b4: Te6edf3ListTff7b72<Tffa657IntTff7b72> Tff7b72= Te6edf3listOfTb4b4b4(T79c0ff0Tb4b4b4, T79c0ff1T79c0ff0T79c0ff0Tb4b4b4, T79c0ff2T79c0ff5T79c0ff0Tb4b4b4, T79c0ff5T79c0ff0T79c0ff0Tb4b4b4, T79c0ff1T79c0ff0T79c0ff0T79c0ff0Tb4b4b4, T79c0ff2T79c0ff0T79c0ff0T79c0ff0Tb4b4b4, T79c0ff5T79c0ff0T79c0ff0T79c0ff0Tb4b4b4)
T8b949e/** Off, ~250 ft, ~500 ft, ~1000 ft, 1 mi, 2 mi, 5 mi (stored as metres). */
Tff7b72val Te6edf3IMPERIAL_METERSTb4b4b4: Te6edf3ListTff7b72<Tffa657IntTff7b72> Tff7b72= Te6edf3listOfTb4b4b4(T79c0ff0Tb4b4b4, T79c0ff7T79c0ff6Tb4b4b4, T79c0ff1T79c0ff5T79c0ff2Tb4b4b4, T79c0ff3T79c0ff0T79c0ff5Tb4b4b4, T79c0ff1T79c0ff6T79c0ff0T79c0ff9Tb4b4b4, T79c0ff3T79c0ff2T79c0ff1T79c0ff9Tb4b4b4, T79c0ff8T79c0ff0T79c0ff4T79c0ff7Tb4b4b4)
Tff7b72fun Td2a8ffforUnitsTb4b4b4(Te6edf3unitsTb4b4b4: Te6edf3DisplayUnitsTb4b4b4)Tb4b4b4: Te6edf3ListTff7b72<Tffa657IntTff7b72> Tff7b72=
Tff7b72if Tb4b4b4(Te6edf3units Tff7b72=Tff7b72= Te6edf3DisplayUnitsTb4b4b4.Te6edf3IMPERIALTb4b4b4) Te6edf3IMPERIAL_METERS Tff7b72else Te6edf3METRIC_METERS
T8b949e/** The preset (in the active unit system) closest to [meters] — used to highlight the current selection. */
Tff7b72fun Td2a8ffnearestTb4b4b4(Te6edf3metersTb4b4b4: Tffa657IntTb4b4b4, Te6edf3unitsTb4b4b4: Te6edf3DisplayUnitsTb4b4b4)Tb4b4b4: Tffa657Int Tff7b72= Te6edf3forUnitsTb4b4b4(Te6edf3unitsTb4b4b4)Tb4b4b4.Te6edf3minBy Tb4b4b4{ Te6edf3absTb4b4b4(Tffa657it Tff7b72- Te6edf3metersTb4b4b4) Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s